package com.zjpavt.client.artnet.device;

public class ColorConst {
    public static final byte[] WHITE = {-1, -1, -1};
    public static final byte[] RED = {-1, 0, 0};
    public static final byte[] GREEN = {0, -1, 0};
    public static final byte[] BLUE = {0, 0, -1};
    public static final byte[] YELLOW = {-1, -1, 0};
    public static final byte[] BLACK = {0, 0, 0};

    public static final byte[] WHITE10 = {25, 25, 25};
    public static final byte[] RED10 = {25, 0, 0};
    public static final byte[] GREEN10 = {0, 25, 0};
    public static final byte[] BLUE10 = {0, 0, 25};
    public static final byte[] YELLOW10 = {25, 25, 0};
    public static byte[] tiaoxiang(byte[] color,double xiangwie) {
        byte[] newColor = new byte[color.length];
        for (int i = 0; i < color.length; i++) {
            newColor[i] = (byte)(xiangwie * byte2Int256(color[i]));
        }
        return newColor;
    }

    public static int byte2Int256(byte rgb) {
        if (rgb < 0) {
            return 256 + rgb;

        } else {
            return rgb;
        }
    }
}
